function [spx, spy, line_handles] = acquire_vslice_line ( )
% ACQUIRE_VSLICE_LINE:  interactively defines a vslice line
%
% This routine collects control points and draws a splined line
% until the user designates the last control point with a right
% mouse click.
%
% PARAMETERS:
% Input:
%    None.
% Output:
%    spx, spy:  
%        spline definition for the x and y coordinates of the line
%    line_handles:
%         Four lines that depict the vslice velocity line on the 
%         hslice figure.  The first is a thin high resolution line.
%         The second is a thick high resolution line that fits 
%         underneath the first.  The third is a line of asterisks
%         at the control points defining the line.  These asterisks
%         fit into the fourth line, which is just a set of 'o'
%         markers.
%
% Calls:
%    create_vslice_line, draw_vslice_line
% Called by:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $Name: rslice-0_9_2 $
% $Id: acquire_vslice_line.m,v 1.3 2005/07/07 15:19:33 jevans Exp $
% AUTHOR:  johnevans@acm.org
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%         
% Default return values.
spx = [];
spy = [];
line_handles = [];

%
% Loop until the user has finished giving us input points.
k = 0;
moredata = 1;
while moredata

	%
	% Get a new point and add it to our list.
	[x,y,button] = ginput(1);
	k = k+1;
	control_pt_x(k,1) = x;
	control_pt_y(k,1) = y;
	num_points = k;

	%
	% Delete the lines at each step.  Need to do this AFTER
	% we get the input.  If we did it before the ginput call, we'd
	% never see the line.
	try
		delete ( line_handles );
	catch
		;
	end



	[spx, spy] = create_vslice_line ( control_pt_x, control_pt_y );

	hold on
	[line_handles] = draw_vslice_line ( control_pt_x, control_pt_y, spx, spy );

	%
	% terminate if a right mouse click
	if ( button ~= 1 )
		return;
	end

end % moredata loop









